#region Imported Namespaces



using System;
using System.Collections.ObjectModel;



#endregion


namespace WtfManager.Framework
{
  ///<summary>
  /// Represents a read-only services collection.
  ///</summary>
  public class ReadOnlyServicesCollection: ReadOnlyObservableCollection<Service>
  {
    #region Fields



    private readonly ServicesCollection _collection;



    #endregion


    #region Constructors/Finalizers



    ///<summary>
    /// Default ReadOnlyServicesCollection.
    ///</summary>
    public ReadOnlyServicesCollection(ServicesCollection collection)
      : base(collection)
    {
      _collection = collection;
    }



    #endregion


    #region Properties/Indexers



    ///<summary>
    /// Gets a service by a specified name.
    ///</summary>
    public Service this[string name]
    {
      get
      {
        return _collection[name];
      }
    }


    ///<summary>
    /// Gets a service by a specified type.
    ///</summary>
    public Service this[Type type]
    {
      get
      {
        return _collection[type];
      }
    }



    #endregion
  }
}